﻿using System.ComponentModel.DataAnnotations;
using Localization;
using SinBiota.Model.Entities.CustomAttributes;

namespace SinBiota.Model.Entities
{
    [LocalizedName("ConservationUnit", NameResourceType = typeof(Strings))]
    public class ConservationUnit : BaseEntity
    {
        [LocalizedName("Name", NameResourceType = typeof(Strings))]
        [Required(ErrorMessageResourceType = typeof(Messages), ErrorMessageResourceName = "FieldCannotBeEmpty")]
        public virtual string Name { get; set; }

        [LocalizedName("Category", NameResourceType = typeof(Strings))]
        [Required(ErrorMessageResourceType = typeof(Messages), ErrorMessageResourceName = "FieldCannotBeEmpty")]
        public virtual string Category { get; set; }

        [LocalizedName("IdWCMC", NameResourceType = typeof(Strings))]
        public virtual int IdWCMC { get; set; }

        [LocalizedName("Jurisdiction", NameResourceType = typeof(Strings))]
        [Required(ErrorMessageResourceType = typeof(Messages), ErrorMessageResourceName = "FieldCannotBeEmpty")]
        public virtual string Jurisdiction { get; set; }

        [LocalizedName("YearOfCreation", NameResourceType = typeof(Strings))]
        [Required(ErrorMessageResourceType = typeof(Messages), ErrorMessageResourceName = "FieldCannotBeEmpty")]
        [Range(1950,2020, ErrorMessageResourceType = typeof(Messages), ErrorMessageResourceName = "FieldOutOfRange")]
        public virtual int YearOfCreation { get; set; }
    }
}
